# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dmde
pkgver=4.2.2.816
pkgrel=1
pkgdesc='Disk Editor and Data Recovery Software.'
arch=('x86_64')
groups=('blackarch' 'blackarch-forensic')
url='https://dmde.com/download.html'
license=('custom:unknown')
depends=('gtk2')
source=("https://dmde.com/download/$pkgname-${pkgver//./-}-lin64-gui.zip")
sha512sums=('c2f65fc61f1234fa4e7e07c0dd9dab02a187622b6c14653123d1f71e291d7d22db9d137253a75861de15233b8c4e3f30edec5e7a631bb9e8e5a21f1958f06395')

package() {
  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" readme.txt deviohsc.txt \
    changelog.txt
  install -Dm 644 eula.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm "$pkgname-${pkgver//./-}-lin64-gui.zip"

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ./$pkgname "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

